
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class SUM_PARTS_STOCKMap : EntityTypeConfiguration<SUM_PARTS_STOCK>
    {
        public SUM_PARTS_STOCKMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.AGENT_NAME)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.PARTS_NAME)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.SUPPLIER_NAME)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("SUM_PARTS_STOCK");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SUM_DATE).HasColumnName("SUM_DATE");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.AGENT_NAME).HasColumnName("AGENT_NAME");
            this.Property(t => t.PARTS_ID).HasColumnName("PARTS_ID");
            this.Property(t => t.PARTS_NAME).HasColumnName("PARTS_NAME");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SUPPLIER_NAME).HasColumnName("SUPPLIER_NAME");
            this.Property(t => t.INSTOCK).HasColumnName("INSTOCK");
            this.Property(t => t.OUTSTOCK).HasColumnName("OUTSTOCK");
            this.Property(t => t.CURRENT_STOCK).HasColumnName("CURRENT_STOCK");
            this.Property(t => t.TOTAL).HasColumnName("TOTAL");
        }
    }
}
